str = [37596001, 68, 118, 385, 1878, 74, 610798295,
       6, 709532225, 381649088, 7248, 78114959, 995,
       5247, 439091, 5620, 4843, 726 ,538865, 10, 2253581,
       6368599, 79930596, 75, 12230, 91, 93006986, 731479]
result = 0
for i in str:
    result += i
    result *= 113
    if result <= 10000007 :
        continue
    else:
        result %= 10000007
print(result)